﻿<script id="accountsTmpl" type="text/x-jquery-tmpl">
    <table class="accounts_list" id="common_mailboxes">
        <tbody>
            {{tmpl(common_mailboxes, {showSetDefaultIcon: showSetDefaultIcon}) "mailboxItemTmpl"}}
        </tbody>
    </table>
    <table class="accounts_list" id="server_mailboxes">
        <tbody>
            {{tmpl(server_mailboxes, {showSetDefaultIcon: showSetDefaultIcon}) "mailboxItemTmpl"}}
        </tbody>
    </table>
    <table class="accounts_list" id="aliases">
        <tbody>
            {{tmpl(aliases, {showSetDefaultIcon: showSetDefaultIcon}) "aliasItemTmpl"}}
        </tbody>
    </table>
    <table class="accounts_list" id="groups">
        <tbody>
            {{tmpl(groups, {showSetDefaultIcon: showSetDefaultIcon}) "groupItemTmpl"}}
        </tbody>
    </table>
</script>

<script id="mailboxItemTmpl" type="text/x-jquery-tmpl">
    <tr data_id="${email}" class="row with-entity-menu item-row row-hover {{if !enabled}}disabled{{/if}}">
        {{if $item.showSetDefaultIcon}}
        <td class="default_account_button_column">
            {{if !isDefault}}
                <div class="set_as_default_account_icon default_account_icon_block"
                    title="${ASC.Mail.Resources.MailScriptResource.SetAsDefaultAccountText}"></div>
            {{else}}
                <div class="default_account_icon default_account_icon_block"
                    title="${ASC.Mail.Resources.MailScriptResource.DefaultAccountText}"></div>
            {{/if}}
        </td>
        {{/if}}
        <td class="address">
            <span class="accountname" title="${email}">${email}</span>
        </td>
        <td class="notify_column">
            {{if !enabled}}
                <span style="margin-left: 16px;display: inline-block;" class="red-text notification" title="${ASC.Mail.Resources.MailResource.AccountDisableForReceiving}">
                    ${ASC.Mail.Resources.MailResource.AccountDisableForReceiving}&nbsp;<a class="link dotline red-text" style="border-bottom: 1px dotted;display: inline-block;" onclick="javascript:accountsModal.activateAccount('${email}', true);">${ASC.Mail.Resources.MailResource.TurnOnAccountLabel}</a>
                </span>
            {{else}}
                {{if showEnabledAutoreply}}
                    <span style="margin-left: 16px;display: inline-block;" class="red-text notification" title="${ASC.Mail.Resources.MailResource.EnabledAutoreplyNotification}">
                        ${ASC.Mail.Resources.MailResource.EnabledAutoreplyNotification}&nbsp;<a class="link dotline red-text" style="border-bottom: 1px dotted;display: inline-block;" onclick="javascript:accountsPage.turnAutoreply('${email}', false);">${ASC.Mail.Resources.MailResource.TurnOffAutoreplyLabel}</a>
                    </span>
                {{else}}
                    {{if !isTeamlabMailbox && oAuthConnection}}
                        <span class="notification" title="${ASC.Mail.Resources.MailScriptResource.AccountNotificationText}">${ASC.Mail.Resources.MailScriptResource.AccountNotificationText}</span>
                    {{/if}}
                {{/if}}
            {{/if}}
        </td>
        <td class="manage_signature_column">
            <div class="btn-row __list" title="${ASC.Mail.Resources.MailScriptResource.ManageSignatureLabel}" onclick="accountsModal.showSignatureBox('${email}');">
                ${ASC.Mail.Resources.MailScriptResource.ManageSignatureLabel}
            </div>
        </td>
        <td class="menu_column">
            <div class="entity-menu" title="${ASC.Mail.Resources.MailScriptResource.Actions}" data_id="${email}"></div>
        </td>
    </tr>
</script>

<script id="groupItemTmpl" type="text/x-jquery-tmpl">
    <tr data_id="${email}" class="row item-row row-hover inactive {{if !enabled}}disabled{{/if}}">
        {{if $item.showSetDefaultIcon}}
            <td class="default_account_button_column">
                <div class="group_default_account_icon_block" title="${ASC.Mail.Resources.MailScriptResource.GroupCouldNotSetAsDefault}"></div>
            </td>
        {{/if}}
        <td class="address">
            <span class="accountname" title="${email}">${email}</span>
        </td>
        <td class="notify_column">
            <span class="notification" title="${ASC.Mail.Resources.MailResource.GroupNotificationText}">${ASC.Mail.Resources.MailResource.GroupNotificationText}</span>
        </td>
    </tr>
</script>

<script id="aliasItemTmpl" type="text/x-jquery-tmpl">
    <tr data_id="${email}" class="row item-row row-hover inactive {{if !enabled}}disabled{{/if}}">
        {{if $item.showSetDefaultIcon}}
            <td class="default_account_button_column">
                {{if !isDefault}}
                    <div class="set_as_default_account_icon default_account_icon_block"
                         title="${ASC.Mail.Resources.MailScriptResource.SetAsDefaultAccountText}"></div>
                {{else}}
                    <div class="default_account_icon default_account_icon_block"
                         title="${ASC.Mail.Resources.MailScriptResource.DefaultAccountText}"></div>
                {{/if}}
            </td>
        {{/if}}
        <td class="address">
            <span class="accountname" title="${email}">${email}</span>
        </td>
        <td class="notify_column">
            {{if !enabled}}
                <span style="margin-left: 16px;display: inline-block;" class="red-text notification" title="${ASC.Mail.Resources.MailResource.AccountDisableForReceiving}">
                    ${ASC.Mail.Resources.MailResource.AccountDisableForReceiving}
                    <a class="link dotline red-text" style="border-bottom: 1px dotted;display: inline-block;" onclick="javascript:accountsModal.activateAccount('${email}', true);">${ASC.Mail.Resources.MailResource.TurnOnAccountLabel}</a>
                </span>
            {{else}}
                {{if showEnabledAutoreply}}
                    <span style="margin-left: 16px;display: inline-block;" class="red-text notification" title="${ASC.Mail.Resources.MailResource.EnabledAutoreplyNotification}">
                        ${ASC.Mail.Resources.MailResource.EnabledAutoreplyNotification}
                        <a class="link dotline red-text" style="border-bottom: 1px dotted;display: inline-block;" onclick="javascript:accountsPage.turnAutoreply('${email}', false);">${ASC.Mail.Resources.MailResource.TurnOffAutoreplyLabel}</a>
                    </span>
                {{else}}
                    <span class="notification" title="${ASC.Mail.Resources.MailScriptResource.AliasNotificationText.replace('%mailbox_address%', $data.realEmail)}">
                        ${ASC.Mail.Resources.MailScriptResource.AliasNotificationText.replace('%mailbox_address%', $data.realEmail)}</span>
                {{/if}}
            {{/if}}
        </td>
    </tr>
</script>

<script id="setDefaultIconItemTmpl" type="text/x-jquery-tmpl">
    <td class="default_account_button_column">
        {{if !isDefault}}
            <div class="set_as_default_account_icon default_account_icon_block"
                 title="${ASC.Mail.Resources.MailScriptResource.SetAsDefaultAccountText}"></div>
        {{else}}
            <div class="default_account_icon default_account_icon_block"
                 title="${ASC.Mail.Resources.MailScriptResource.DefaultAccountText}"></div>
        {{/if}}
    </td>
</script>